<?php
/**
 * 文章系统 >> 文章分类 
 *
 *
 */

$G_msg  = array(
    'jobs'  => array('c.add' => null, 'c.li' => null ),
    'redirect' => 'c.li'
    );

require($abs_modpath . '/article_class.libs.php');
if(in_array($action, array('', 'c.index', 'c.li'))) {
    // 分类列表
    extract(cli(), EXTR_OVERWRITE);
    $cur_view   = 'views/class_li_view.php';
} elseif(in_array($action, array('c.add', 'c.modify'))) {
    // 添加/修改
    if($save == $save_flag) {
        if(($action == 'c.add' && $cid = cadd()) && $cid > 0) {
            $G_msg['msg']   = '新增栏目成功！';
        } elseif(($action == 'c.modify' && $cid = cmodify()) && $cid > 0) {
            $G_msg['msg']   = '修改栏目成功！';
        } else {
            $cid = 0;
            if($GLOBALS['ERR']->Count == 0) add_system_error();
        }

        if($cid > 0) {
            // 成功后操作
            $G_msg['jobs']['c.modify']   = array(
                    'param' => 'cid=' . $cid,
                    'name'  => '修改当前分类内容'
                    );
            message();
        }
    } else {
        InitGP(array('pid', 'cid'), 'G');
        $record = cread($cid, $pid);
        $cur_view   = 'views/class_data_view.php';
    }
} elseif(in_array($action, array('c.del'))) {
    // 删除
    cdel();

}
?>